package drongo.model.events
{
	import flash.events.Event;
	
	public class ModelEvent extends Event
	{
		public static const VALUE_CHANGED:String="ModelEvent.VALUE_CHANGED";
		
		public static const ADD_CHILD:String="ModelEvent.ADD_CHILD";
		
		public static const REMOVE_CHILD:String="ModelEvent.REMOVE_CHILD";
		
		public static const CHILD_VALUE_CHANGED:String="ModelEvent.CHILD_VALUE_CHANGED";
		
		public var key:String;
		public var newValue:*;
		public var oldValue:*;
		public function ModelEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
		}
		
		public static function Create(type:String,newValue:*=null,oldValue:*=null,key:String=null):ModelEvent{
			var result:ModelEvent=new ModelEvent(type);
			result.oldValue=oldValue;
			result.newValue=newValue;
			result.key=key;
			return result;
		}
	}
}